﻿using Microsoft.AspNetCore.Builder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Swagger.Config.Middlewares
{
    public static class SwaggerMiddleware
    {
        public static void UseSwagger(this IApplicationBuilder app)
        {
            if (app == null) throw new ArgumentNullException(nameof(app));
            Microsoft.AspNetCore.Builder.SwaggerBuilderExtensions.UseSwagger(app);
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "NetFast.Core.API");
                c.RoutePrefix = string.Empty;
            });
        }
    }
}
